package com.cleaningcloud.cld.mapper;

import com.cleaningcloud.cld.domain.CldAssetsRepair;
import com.cleaningcloud.cld.domain.dto.CldAssetsRecordDto;
import com.cleaningcloud.cld.domain.vo.CldAssetsRepairDetailsVo;
import com.cleaningcloud.cld.domain.vo.CldAssetsRepairVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 资产维修Mapper接口
 * 
 * @author cleaningcloud
 * @date 2024-10-06
 */
public interface CldAssetsRepairMapper
{
    /**
     * 查询资产维修记录
     *
     * @param cldAssetsRepairDto 资产记录
     * @return 资产记录集合
     */
    List<CldAssetsRepairVo> getRepairList(CldAssetsRecordDto cldAssetsRepairDto);


    /**
     * 查询资产维修记录
     *
     * @param cldAssetsRepairDto 资产记录
     * @return 资产记录集合
     */
    List<CldAssetsRepairVo> getRepairGroupProjectList(CldAssetsRecordDto cldAssetsRepairDto);

    /**
     * 查询资产维修明细记录
     *
     * @param cldAssetsRepairDto 资产记录
     * @return 资产记录集合
     */
    List<CldAssetsRepairVo> getRepairDetailsList(CldAssetsRecordDto cldAssetsRepairDto);


    /**
     * 根据资产记录id查询维修记录详情
     * @param assetsRecordId
     * @return
     */
    CldAssetsRepairVo getRepairDetailsByRecordId(Long assetsRecordId);


    /**
     * 批量新增资产维修配件
     * @param list
     */
    void batchInsertRepairDetails(@Param("list")List<CldAssetsRepair> list);

    /**
     * 根据资产记录id删除
     * @param assetsRecordId
     */
    @Delete("delete from cld_assets_repair where assets_record_id = #{assetsRecordId}")
    void batchDeleteRepairDetailsByRecordId(@Param("assetsRecordId") Long assetsRecordId);

    /**
     * @Author Shaw
     * @Description 根据记录ID查询维修配件列表信息
     * @date: 2025-06-06 15:13
     * @param: //TODO
     */
    List<CldAssetsRepairVo> getRepairListByAssetsRecordId(Long assetsRecordId);

    /**
     * @Author Shaw
     * @Description 获取资产维修配件列表
     * @date: 2025-07-18 16:11
     * @param: //TODO
     */
    List<CldAssetsRepairDetailsVo> getRepairListByRecordId(Long assetsRecordId);
}
